cmake_minimum_required(VERSION 3.9)
cmake_policy(SET CMP0042 NEW)
set (CMAKE_CXX_STANDARD 11)

project (addon)
include_directories(${CMAKE_JS_INC})
file(GLOB SOURCE_FILES  *.cc)
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${CMAKE_JS_SRC})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
target_link_libraries(${PROJECT_NAME} ${CMAKE_JS_LIB})

target_include_directories(${PROJECT_NAME} PRIVATE /home/ohos/curl/include)
target_link_directories(${PROJECT_NAME} PRIVATE /home/ohos/curl/build/lib)
target_link_libraries(${PROJECT_NAME} PRIVATE curl-d)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS -Wl,--rpath=/home/ohos/curl/build/lib)

# Define NAPI_VERSION
add_definitions(-DNAPI_VERSION=8)
